<script>
import input from './atom/jInput.vue'
import select from './atom/jSelect.vue'
import datePicker from './atom/jClock.vue'
import upload from './atom/jUpload.vue'
import row from './atom/jRow.vue'
import {h, resolveComponent} from 'vue'

export default {
    name: "atomComponent",
    props: {
        atom: {
            type: Object
        }
    },
    components: {input, select, datePicker, upload, row},
    created() {
        console.log(this.atom.type)
    },
    // 第一种写法 Setup resolveComponents
    // setup(props) {
    //     return () => {
    //         return h(resolveComponent(props.atom.type),{options:props.atom.options},[])
    //     }
    // }
    // 第二种写法 Render resolveComponents
    render(){
        return h(resolveComponent(this.atom.type),{obj: this.atom},() => [])
    }
}
</script>

<style scoped>
</style>
